
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  padding: 50px;
  background: lightblue;
  color: white;
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

nav {
  position: fixed;
  top: 100px;
  left: 0;
  width: 60px;
  height: 100vh;
 /*  background: crimson; */

  z-index: 500 !important;


}

nav ul {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  list-style: none;
  height: 100%;
  font-size: 0;
}

nav ul li {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: crimson;
  position: relative;
  transition: all 0.4s ease-out;
  overflow: hidden;
  font-size: 24px;
}
.icon-wrapper {
  background: crimson;
  padding: 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-wrapper i {
  color: white;
  font-size: 24px;
}

nav ul li:after {
  content: attr(data-label);
  position: absolute;
 /*  bottom: -100%; */
 /*  left: 0; */
    left: -100%; /* bắt đầu từ bên trái */
  width: 100%;
  height: 100%;
  background: white;
  color: crimson;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* transition: bottom 0.4s ease; */
   transition: left 0.4s ease;
  z-index: 2;
   
  
  
}

nav ul li:hover:after {
 /*  bottom: 0; */
   left: 0;
}

nav ul li:hover .icon {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.icon {
  font-size: 28px;
  color: white;
  transition: opacity 0.2s ease;
}

/* Responsive: horizontal menu on small screens */
@media (max-width: 768px) {
  nav {
    width: 100%;
    height: auto;
	top: 0px;
  }

  nav ul {
    flex-direction: row;
    height: auto;
    justify-content: center;
  }

  nav ul li {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  nav ul li:after {
    font-size: 12px;
	top: auto;
    bottom: -100%;
    left: 0;
    transition: bottom 0.4s ease;
  }


  nav ul li:hover:after {
    bottom: 0;
    left: 0; /* giữ nguyên */
  }


  .icon {
    font-size: 22px;
  }
}
